//
//  XHMBTextStreamViewController.m
//  ZZNetWorker_Example
//
//  Created by ZengLiZhi on 2024/7/12.
//  Copyright © 2024 zenglizhi. All rights reserved.
//

#import "XHMBTextStreamViewController.h"
#import "ZZNetWorker.h"

@interface XHMBTextStreamViewController ()

@end

@implementation XHMBTextStreamViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSDictionary *dic = @{
        @"abstractInfo":@"在软件开发的全面测试环节中，功能测试、安全测试和接口测试是三个核心领域，它们共同确保软件产品的质量和用户体验。",
        @"attributeId":@"1807967384109797378",
        @"docType":@"1707111661048961600",
//        @"documentIdsList":@[],
        @"generateId":@"b0321d1f52874c688dcef891709349df",
        @"generateTime":@"6676",
        @"keywords":@[@"接口", @"功能", @"性能", @"安全"],
        @"outlines":@[
            @{
              @"groupTitle": @"功能测试：确保功能完整与正确",
              @"subtitles": @[
                @"核心功能的验证与执行",
                @"模块功能的独立与集成测试",
                @"边缘情况的场景模拟与检查"
              ]
            }
        ],
        @"sensitiveWords":@0,
        @"supplyInfo":@{
          @"infos": @[
            @"模块,UI，功能点"
          ]
        },
        @"title":@"功能测试内容范围安全测试范围接口测试范围",
        @"turnoverId":@"99def2ce84f0c5ae633bc94f94af0c7b",
    };
  
//    ZZNetWorker.SteamText
//        .zz_url(@"ai-new-writing/generate/text")
//        .zz_param(dic)
////        .zz_testResponse(@{@"code":@"200",@"data":@{@"token":@"token123456"}})
//    .zz_completion(^(ZZNetWorkResponse * _Nonnull response, NSError * _Nonnull error) {
//        
//    });
    
    ZZNetWorker.POST
        .zz_url(@"aiQuestionAnswer/answer")
        .zz_param(@{@"content":@"请帮我写10个北京旅游宣传标语"})
        .zz_receiveData(^(NSURLSession * _Nonnull session, NSURLSessionDataTask * _Nonnull dataTask, NSData * _Nonnull data) {
            NSString *receiveStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
            ZZLog(@"%@", receiveStr);
            NSDictionary *dic = [[ZZNetWorker woker].decode decodeToJson:data];
            if (dic) {
                
            }
            dispatch_main_async_safe(^{
                
                self.textLabel.text = receiveStr;
            });
        })
    .zz_completion(^(ZZNetWorkResponse * _Nonnull response, NSError * _Nonnull error) {
        
    });
    
//    ZZNetWorker.POST
//        .zz_url(@"ai-writing/manuscript/detail")
//        .zz_param(@{@"id":@"1807967384109797378"})
////        .zz_testResponse(@{@"code":@"200",@"data":@{@"token":@"token123456"}})
//    .zz_completion(^(ZZNetWorkResponse * _Nonnull response, NSError * _Nonnull error) {
//        
//    });
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
